object prac3{
  def addOne(list:List[Int]):List[Int]=list.map(x=>x+1)
  def filterEven(list:List[Int]):List[Int]=list.filter(x=>x%2==0)
  def mapReduce(list:List[Int])(mapF:Int=>Int)(reduceF:(Int,Int)=>Int):Int={
    list.map(mapF).reduce(reduceF)
  }
  def main(args:Array[String]){
    val list=List(1,2,3,4,5,6,7,8,9,10)
    val add=addOne(list)
    println(add)
    val filter=filterEven(list)
    println(filter)
    val map=mapReduce(list)(x=>x*2)(_+_)
    println(map)
  }
}
